<template>
<div>
	<ul>
		<li @click="showMessageBox">showMessageBox</li>
		<li @click="showErrorBox">showErrorBox</li>
	</ul>
</div>
</template>

<script lang="ts">
import { computed, defineComponent } from 'vue'
import { mapGetters, mapState, useStore } from "vuex";
import { dialog } from "@electron/remote";
import { BrowserWindow } from "electron";

export default defineComponent({
	name: "Page__Dialog",
	data() {
		return {
			num: 1234567
		}
	},

	methods: {
		showMessageBox() {

			// dialog.showErrorBox('xx', 'fffffff');
			dialog.showMessageBox({
				type: 'info',
				title: '提示信息',
				message: '内容',
				buttons: ['ok', 'no']
			}).then(d => {
				console.log('d', d)
				console.log('d.response', d.response)
			})
			;
		},
		showErrorBox() {
			dialog.showErrorBox('xx', 'fffffff');
		},
	},

	setup() {
		// 组合是API中使用store
		const store = useStore()

		const storeX = computed(() => store.state.moduleA.x)

		return {
			storeX
		}
	}
})
</script>

<style scoped lang="less">

</style>
